package com.ebupt.migu.music.approve.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.ebupt.migu.music.approve.entity.ApproveHistory;
import org.apache.ibatis.annotations.Mapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Intellij IDEA.
 * User:  liuyangyang@cd.ebupt.com
 * Date:  2019/10/9
 */
@Mapper
@DS("mysql_mg")
public interface ApproveMapper {

    /**
     * 创建审批记录
     *
     * @param approve
     */
    void createApprove(ApproveHistory approve);

    /**
     * 创建审批记录- map
     *
     * @param params
     */
    void createApproveByMap(Map<String, Object> params);

    /**
     * 统计查询条件下有多少条审批记录
     *
     * @param params
     * @return
     */
    Integer countApproveList(Map<String, Object> params);

    /**
     * 分页、条件查询审批记录列表
     *
     * @param params
     * @return
     */
    List<HashMap<String, Object>> queryApproveList(Map<String, Object> params);

    /**
     * 更新策略审批状态
     *
     * @param params
     */
    void updateApprove(Map<String, Object> params);

    /**
     * 更新策略审批状态
     *
     * @param params
     */
    void updateStatus(Map<String, Object> params);

    /**
     * 通过策略ID查询审批记录
     *
     * @param strategyId
     * @return
     */
    List<HashMap<String, Object>> queryApproveByStrategyId(String strategyId);


    /**
     * 通过策略ID查询审批记录
     *
     * @param strategyId
     * @return
     */
    HashMap<String, Object> queryApproveByName(String strategyId);

    void deleteApproveInfo(Map<String, Object> params);
}
